package com.thoughtworks.collection;

import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import java.util.List;
import java.util.stream.Collectors;

public class Reduce {

    List<Integer> arrayList;


    public Reduce(List<Integer> arrayList) {

        this.arrayList = arrayList;
    }

    public int getMaximum() {

        return arrayList.stream().max(Integer::compare).get();
    }

    public double getMinimum() {

        return arrayList.stream().min(Integer::compare).get();
    }

    public double getAverage() {

        double sum = arrayList.stream().reduce(0,(pre, cur)-> pre + cur);
        return sum / arrayList.size();
    }

    public double getOrderedMedian() {
        throw new NotImplementedException();
    }

    public int getFirstEven() {

        throw new NotImplementedException();
    }

    public int getIndexOfFirstEven() {

        throw new NotImplementedException();
    }

    public boolean isEqual(List<Integer> arrayList) {

        throw new NotImplementedException();
    }

    public Double getMedianInLinkList(SingleLink singleLink) {

        throw new NotImplementedException();
    }

    public int getLastOdd() {

        throw new NotImplementedException();
    }

    public int getIndexOfLastOdd() {

        throw new NotImplementedException();
    }
}
